package com.shenmazong.label.controller;

import com.shenmazong.label.entity.TbTaskLabel;
import com.shenmazong.label.entity.TbTaskLabelType;
import com.shenmazong.label.service.TaskLabelService;
import com.shenmazong.utils.ResultResponse;
import com.shenmazong.vo.BatchChooseIdVo;
import com.shenmazong.vo.ListParamVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @description 标签管理控制层
 * @author Qi
 * @date 2021/9/18 17:08
 * @version 1.0
 */

@Api(tags = "标签管理")
@RestController
@RequestMapping("label")
public class TaskLabelController {

    @Autowired
    private TaskLabelService labelService;
    
    /**
     * @description 作业标签增加
     * @params [tbTaskLabel]
     * @return com.shenmazong.utils.ResultResponse
     * @author Qi
     * @date 2021/9/19 7:58
     */
    @PostMapping("saveTaskLabel")
    public ResultResponse saveTaskLabel(@RequestBody TbTaskLabel tbTaskLabel){
        return labelService.saveTaskLabel(tbTaskLabel);
    }

    /**
     * @description 作业标签批删
     * @params [chooseIdVo]
     * @return com.shenmazong.utils.ResultResponse
     * @author Qi
     * @date 2021/9/19 7:58
     */
    @PostMapping("deleteTaskLabel")
    public ResultResponse deleteTaskLabel(@RequestBody BatchChooseIdVo chooseIdVo){
        return labelService.deleteTaskLabel(chooseIdVo);
    }

    /**
     * @description 作业标签修改
     * @params [tbTaskLabel]
     * @return com.shenmazong.utils.ResultResponse
     * @author Qi
     * @date 2021/9/19 7:58
     */
    @PostMapping("updateTaskLabel")
    public ResultResponse updateTaskLabel(@RequestBody TbTaskLabel tbTaskLabel){
        return labelService.updateTaskLabel(tbTaskLabel);
    }

    /**
     * @description 作业标签列表
     * @params [pageQueryVo]
     * @return com.shenmazong.utils.ResultResponse
     * @author Qi
     * @date 2021/9/19 7:58
     */
    @PostMapping("listTaskLabel")
    public ResultResponse listTaskLabel(@RequestBody ListParamVo pageQueryVo){
        return labelService.listTaskLabel(pageQueryVo);
    }

    /**
     * @description 获取所有作业标签
     * @params []
     * @return com.shenmazong.utils.ResultResponse
     * @author Qi
     * @date 2021/9/19 8:03
     */
    @PostMapping("listAllTaskLabel")
    public ResultResponse listAllTaskLabel(@RequestBody TbTaskLabel taskLabel){
        return labelService.listAllTaskLabel(taskLabel);
    }

    /**
     * @description 获取所有作业标签类型
     * @params [taskLabelType]
     * @return com.shenmazong.utils.ResultResponse
     * @author Qi
     * @date 2021/9/19 7:58
     */
    @PostMapping("listAllTaskLabelType")
    public ResultResponse listAllTaskLabelType(){
        return labelService.listAllTaskLabelType();
    }

    @PostMapping("saveTaskLabelType")
    public ResultResponse saveTaskLabelType(@RequestBody TbTaskLabelType taskLabelType){
        return labelService.saveTaskLabelType(taskLabelType);
    }

    @PostMapping("deleteTaskLabelType")
    public ResultResponse deleteTaskLabelType(@RequestBody BatchChooseIdVo chooseIdVo){
        return labelService.deleteTaskLabelType(chooseIdVo);
    }

    @PostMapping("updateTaskLabelType")
    public ResultResponse updateTaskLabelType(@RequestBody TbTaskLabelType taskLabelType){
        return labelService.updateTaskLabelType(taskLabelType);
    }

}




